package edu.sctu.xiangkun.day201505.day20150517;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by user08 on 2015/5/17.
 */



public class TextOne extends TextMore {

    List<Teacher> teaCherslist = new ArrayList<>();
    List<Student> studentlist = new ArrayList<>();

    public void getTercherInfo(){

        teaCherslist = sotrNumber();

        System.out.println("按教师编号排序后：");

        for (int i = 0; i < teaCherslist.size() ; i++) {

            System.out.println("编号：" + teaCherslist.get(i).getNumber());
            System.out.println("姓名：" + teaCherslist.get(i).getName());
            System.out.println("职称：" + teaCherslist.get(i).getTitle());
            System.out.println("性别：" + teaCherslist.get(i).getSex());
            System.out.println("所授课程：" + teaCherslist.get(i).getCourse());

            for (int j = 0; j < teaCherslist.get(i).getStudents().size(); j++) {

                System.out.println("所教学生："+teaCherslist.get(i).getStudents().get(j).getName());
            }
            System.out.println();

        }
    }

    public int getStudent(int code){

        studentlist = sortStudent();

        System.out.println("学生成绩排序后的成绩大于coed的学生:");

        for(Student student : studentlist){
            if(Integer.parseInt(student.getScore()) > code){

                System.out.println("学号："+student.getStudentID());
                System.out.println("姓名："+student.getName());
                System.out.println("成绩："+student.getScore());
                System.out.println("性别："+student.getSex());
                System.out.println("住址："+student.getAddress());

                System.out.println();
            }
        }
        return code;
    }

    public void getCode(MyInterface interFaceStudent){

        teaCherslist =  pritCoded();

        System.out.println("职称为教授的学生有"+teaCherslist.size()+"个");
        System.out.println("其学生基本信息为：");


        for(Teacher teaCher : teaCherslist){

            for (int i = 0; i < teaCher.getStudents().size(); i++) {

                System.out.println("学号："+teaCher.getStudents().get(i).getStudentID());
                System.out.println("姓名：" + teaCher.getStudents().get(i).getName());
                System.out.println("成绩：" +teaCher.getStudents().get(i).getScore());
                System.out.println("性别：" +teaCher.getStudents().get(i).getSex());
                System.out.println("住址："+teaCher.getStudents().get(i).getAddress());
                System.out.println();

            }

            interFaceStudent.getInfo(teaCher.getStudents());


        }
    }
}
